<?php

class sgeRouteCollection extends sfDoctrineRouteCollection
{

	public function getRouteForReport()
	{
		return new $this->routeClass(
			sprintf('%s/:%s/reporte.pdf.:sf_format', $this->options['prefix_path'], $this->options['column']),
			array_merge(array('module' => $this->options['module'], 'action' => 'report', 'sf_format' => 'html'), $this->options['default_params']),
			array_merge($this->options['requirements'], array('sf_method' => array('get'))),
			array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'])
		);
	}

	public function getRouteForListReport()
	{
		return new $this->routeClass(
			sprintf('%s/reporte_lista.pdf.:sf_format', $this->options['prefix_path']),
			array_merge(array('module' => $this->options['module'], 'action' => 'listReport', 'sf_format' => 'html'), $this->options['default_params']),
			array_merge($this->options['requirements'], array('sf_method' => array('get'))),
			array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'])
		);
	}

	public function getRouteForUpload()
	{
		return new $this->routeClass(
			sprintf('%s/subida.:sf_format', $this->options['prefix_path']),
			array_merge(array('module' => $this->options['module'], 'action' => 'upload', 'sf_format' => 'html'), $this->options['default_params']),
			array_merge($this->options['requirements'], array('sf_method' => array('get', 'post'))),
			array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'])
		);
	}

	protected function getDefaultActions()
	{
		return array_merge(array('report', 'listReport', 'upload'), parent::getDefaultActions());
	}

}